<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="./js/vue.js"></script>
</head>
<body>
<div id="aaa">
    <ul>
        <!--for(数据类型 b:数组){}-->
        <li v-for="item in hobby">
            {{item}}--->{{index}}
        </li>
    </ul>
    <table width="200px" border="1">
        <tr>
            <th>姓名</th>
            <th>年龄</th>
            <th>性别</th>
            <th>操作</th>
        </tr>
        <tr v-for="item in users">
            <td>{{item.name}}</td>
            <td>{{item.age}}</td>
            <td>{{item.sex}}</td>
            <td>
                <button @click="deleteUser(item.name)">删除</button>
                <button >编辑</button>
            </td>
        </tr>
    </table>
</div>
</body>
<script>
    let ww=new Vue({
        el:"#aaa",
        data:{
            hobby:["好吃","好喝","好色","好赌"],
            users:[
                {"name":"安志远","age":16,"sex":"女"},
                {"name":"李云宵","age":19,"sex":"男"},
                {"name":"闫锦超","age":15,"sex":"男"}
            ]
        },
        methods:{
            deleteUser(name){
                alert(name);

            },
            fun(){
                console.log("sss")
            }
        }
    })
</script>
</html>